package main

import "fmt"

func main() {
	//接口嵌套
	var ff FlyFish
	ff = Fish{}
	ff.fly()
	ff.swim()
}

// 飞Flyer接口
type Flyer interface {
	fly()
}

// 创建Swimmer接口
type Swimmer interface {
	swim()
}

// 组合一个接口FlyFish
type FlyFish interface {
	Flyer
	Swimmer
}

// 创建一个Fish结构体
type Fish struct {
}

// 实现这个接口
func (fish Fish) fly() {
	fmt.Println("飞------------")
}
func (fish Fish) swim() {
	fmt.Println("游泳-----------")
}
